package com.shujia.mvc2.controller;

import com.shujia.mvc1.Demo02Service;
import com.shujia.mvc2.service.UserService;
import org.junit.Test;

import java.util.Scanner;

public class UserController {
    static UserService us= new UserService();
    @Test
    public static String login(){
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入用户:");
        String username = scanner.next();
        System.out.print("请输入密码:");
        String password = scanner.next();
        String message = us.verification(username, password);

        return message;
    }

    public static String register(){
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入用户:");
        String username = scanner.next();
        System.out.print("请输入密码:");
        String password = scanner.next();
        System.out.print("请再次输入密码:");
        String newPassword = scanner.next();
        String message = us.register(username, password, newPassword);
        return message;
    }
}
